import http from "@/utils/request";

/**
 * 获取权限
 * @returns 
 */
export function getPermissionAPI() {
    return http({
        url: "/sys/permission"
    })
}

// 新增权限
export function addPermissionAPI(data) {
    return http({
        url: '/sys/permission',
        method: 'post',
        data
    })
}

// 更新权限
export function updatePermissionAPI(data) {
    return http({
        url: `/sys/permission/${data.id}`,
        method: 'put',
        data
    })
}

// 删除权限
export function delPermissionAPI(id) {
    return http({
        url: `/sys/permission/${id}`,
        method: 'delete'
    })
}

// 获取权限详情
export function getPermissionDetailAPI(id) {
    return http({
        url: `/sys/permission/${id}`
    })
}